home *** CD-ROM | disk | FTP | other *** search
- Path: news.kreonet.re.kr!usenet
- From: jwhahn@cair.kaist.ac.kr (Jung Hahn)
- Newsgroups: comp.lang.c++
- Subject: Re: need help on VERY simple program. I am a beginner, so this is an easy question!!!
- Date: Wed, 07 Feb 1996 11:47:49 GMT
- Organization: Applied Database Labs, K.A.I.S.T
- Message-ID: <31189141.13549485@news.kreonet.re.kr>
- References: <31158A73.3B43@neosoft.com>
- NNTP-Posting-Host: swine.kaist.ac.kr
- X-Newsreader: Forte Agent .99d/32.168
-
- On Sun, 04 Feb 1996 22:41:23 -0600, reynolds@neosoft.com wrote:
- >
- >main ()
- >{
- > long integer1, integer2, sum, difference, product, quotient;
- > cout << "enter first integer\n";
- > cin >> integer1;
- > cout << "enter second integer\n";
- > cin >> integer2;
- > if (integer1 == integer2)
- > cout << "These two numbers are equal!!\n";
- > if (integer1 > integer2)
- > cout << "First integer greater than second!!\n";
- > else
- >//This is the statement which I want to clear IF integer1 == integer2
- > cout << "Second integer greater than first!!\n";
- >and so on. . .
- > ---John Reynolds
-
- HMM ... Yeah .... SHIT ...
-
- The Basic thing is YOU WANNA cout << "STRING" using the ternary
- operator.
-
- Read the chapter concerning Assignments and then Read the Chapter on
- Pointers ...
-
- then try this.
-
- ( in C )
-
- void main( void)
- {
- char *string1;
- string1 = ( int1==int2) ? "These Two Numbers Are Equal\n"
- : ( int1 > int2) ? "int1 is > than int2\n" : "Else\n";
-
- printf( "%s", string1);
- }
-
-
- ___________
-
- Name: Jung w. Hahn
- Elm: jwhahn@cair.kaist.ac.kr
- Phone: 042-869-2959
-